﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ValidationExample.aspx.cs" Inherits="ValidationExample" %>
<%@ Register TagPrefix="mobile"
    Namespace="System.Web.UI.MobileControls"
    Assembly="System.Web.Mobile" %>
   
<mobile:Form id="Form1" runat="server">
    <mobile:Label runat="server" BreakAfter="false">
        E-mail address:
    </mobile:Label>  
    <mobile:TextBox id="email1" runat="server"/>
    <mobile:RequiredFieldValidator id="RequiredFieldValidator1"
        runat="server"
        ErrorMessage="E-mail address required"
        ControlToValidate="email1"
        Display="None"/>
    <mobile:RegularExpressionValidator id="RegularExpressionValidator1"
        runat="server"
        ControlToValidate="email1"
        ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([- .]\w+)*">
        Not a valid e-mail address
    </mobile:RegularExpressionValidator>
   
    <mobile:Label id="Label2" runat="server" BreakAfter="false">
        Re-type e-mail
    </mobile:Label>
    <mobile:TextBox id="email2" runat="server"/>
    <mobile:RequiredFieldValidator id="RequiredFieldValidator2"
        runat="server"
        ErrorMessage="You must re-type e-mail"
        ControlToValidate="email2"
        Display="None"/>
    <mobile:CompareValidator id="CompareValidator1"
        runat="server"
        ErrorMessage="E-mail addresses do not match. "
        ControlToValidate="email2"
        ControlToCompare="email1"
        Display="None"/>
       
    <mobile:Label id="Label3" runat="server" BreakAfter="false">
        Donation (min. $5)
    </mobile:Label>
    <mobile:TextBox id="donation" runat="server" Password="True"/>
    <mobile:RequiredFieldValidator id="RequiredFieldValidator3"
        runat="server"
        ErrorMessage="You must enter an amount"
        ControlToValidate="donation"
        Display="None"/>
    <!-- The RangeValidator Control requires that a maximum value is set.
        This value could represent the payment ceiling accepted by the 
        online payment service provider -->
    <mobile:RangeValidator id="RangeValidator1"
        runat="server"
        ControlToValidate="donation"
        Type="Currency"
        MinimumValue="5"
        MaximumValue="1000">
    Minimum donation is $5
    </mobile:RangeValidator>
   
    <mobile:Command id="Command1" runat="server">
        Donate!
    </mobile:Command>
    <mobile:ValidationSummary id="ValidationSummary1"
        runat="server"
        FormToValidate="Form1"/>
</mobile:Form>
   
<mobile:Form id="Form2" runat="server">
    <mobile:Label id="Label4" runat="server">
        Thank you for donating.
    </mobile:Label>
</mobile:Form>